<ul class="treeview-menu-overwrite">
  <li class='treeview recursion' >
    <a ng-click='select(set, $event)' href="javascript:void(0)">
      <i class="fa fa-folder-open-o"></i>  <span>{{set.name}}</span>
      <!-- <span class='pull-right' style='margin-right:15px'><i class="fa fa-angle-down"></i></span> -->
      <span class='btn-circle btn-circle-danger pull-right' style='margin-right:15px'><i class="fa fa-minus-circle"></i></span>
      <span class='btn-circle btn-circle-info pull-right' style='margin-right:5px' ng-click='add({parentRule:set})'><i class="fa fa-plus-circle"></i></span>

    </a>
    <!-- 树状列表 -->
    <ul class="treeview-menu-overwrite" ng-include="'recursion'" ng-init='rules=set.children;parent=set'>
    </ul>
  </li>
</ul>

<div class="text-center" style='margin-top:25px'>
  <!-- <button class="btn btn-default btn-xs">保存结构</button> -->
  <button class="btn btn-default btn-sm" style='margin-right:10px'>
    <i class="fa fa-save"></i> 保存</button>
  <button class="btn btn-default btn-sm">
    <i class="fa fa-eye"></i> 预览</button>
</div>


<!-- 递归模板 -->
<script id="recursion" type="text/ng-template">
  <li class="treeview" ng-repeat="rule in rules">
    <a ng-click='select(rule, $event)' href="javascript:void(0)">
      <i class="fa fa-folder-open-o" ng-if='rule.children.length'></i>
      <i class="fa fa-file-text-o" ng-if='!rule.children.length'></i>
      <span>{{rule.name}}</span>
      <span class='btn-circle btn-circle-danger pull-right' style='margin-right:15px'><i class="fa fa-minus-circle"></i></span>
      <span class='btn-circle btn-circle-info pull-right' style='margin-right:5px'><i class="fa fa-plus-circle" ng-click='add({parentRule:rule})'></i></span>
    </a>
    <ul class="treeview-menu-overwrite" ng-if="rule.children.length" ng-include="'recursion'" ng-init="rules=rule.children;parent=rule">
    </ul>
  </li>
</script>
